{% extends "base.html" %}
{% load humanize %}

{% block nav %}
  {% include "stock/nav.html" %}
{% endblock %}

{% block subnav %}
  {% if quote %}
    {{ quote }}
    <ul>
      <li>Snapshot Summary</li>
      <li>News</li>
      <li>Financials</li>
      <li><a href="/stock/{{ quote }}/price">Historical prices</a></li>
      <li><a href="/stock/{{ quote }}/chart">Technical Chart</a></li>
      <li><a href="/stock/{{ quote }}/simulation">Simulation</a></li> 
      <li>VI Statistics</li>
      <li>Profile</li>
    </ul>  
  {% endif %} 
{% endblock %}

{% block toolbar %}
{{ quote }} : Price
{% endblock %}

{% block content %}
  <table style="width: 100%;" >
    <thead>
      <tr>
        <th>Date</th>
        <th>Open</th>
        <th>Close</th>
        <th>High</th>
        <th>Low</th>
        <th>Volume</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody>
    {% for price in stockprice.object_list %}
      <tr align="right">
        <td>{{ price.Date|date:"D d M Y" }}</td>
        <td>{{ price.Open|floatformat:2 }}</td>
        <td>{{ price.Close|floatformat:2 }}</td>
        <td>{{ price.High|floatformat:2 }}</td>
        <td>{{ price.Low|floatformat:2 }}</td>
        <td>{{ price.Vol|intcomma }}</td>
        <td>{{ price.Val|intcomma }}</td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
  <div class="pagination" style="float:right;">
    <span class="step-links">
        {% if stockprice.has_previous %}
            <a href="?page={{ stockprice.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ stockprice.number }} of {{ stockprice.paginator.num_pages }}.
        </span>

        {% if stockprice.has_next %}
            <a href="?page={{ stockprice.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>
{% endblock %}